package com.hnevc.acountms.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.hnevc.acountms.R;
import com.hnevc.acountms.adapter.PictureAdapter;

public class MainActivity extends AppCompatActivity {
    RecyclerView mRecyclerView;
    int[] images=new int[]{R.drawable.addoutaccount,R.drawable.addinaccount,
                            R.drawable.outaccountinfo,R.drawable.inaccountinfo,
                            R.drawable.showinfo,    R.drawable.sysset,
                            R.drawable.accountflag, R.drawable.help,
                            R.drawable.exit};
    String[] titles = new String[]{"新增支出","新增收入","我的支出","我的收入",
                                    "数据管理","系统设置","收支便签","帮助","退出"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

    }

    private void initView() {
        mRecyclerView = (RecyclerView) findViewById(R.id.id_rv_info);
        GridLayoutManager gm = new GridLayoutManager(this,3);
        mRecyclerView.setLayoutManager(gm);
        PictureAdapter adpater = new PictureAdapter(this,images,titles);
        mRecyclerView.setAdapter(adpater);

    }



}
